﻿using System;

namespace octalforty.Syndication.Core.Rss
{
    /// <summary>
    /// Represents a single media object attached to the <see cref="RssItem"/>.
    /// </summary>
    public class RssItemEnclosure
    {
        #region Private Member Variables
        private String url = String.Empty;
        private Int32 length;
        private String mimeType = String.Empty;
        #endregion

        #region Public Properties
        /// <summary>
        /// Gets or sets a <see cref="String"/> which contains the URL where the enclosure is located.
        /// </summary>
        public String Url
        {
            get { return url; }
            set { url = value; }
        }

        /// <summary>
        /// Gets or sets a value which contains the size of the enclosure in bytes.
        /// </summary>
        public Int32 Length
        {
            get { return length; }
            set { length = value; }
        }

        /// <summary>
        /// Gets or sets a <see cref="String"/> which contains the MIME type of the enclosure.
        /// </summary>
        public String MimeType
        {
            get { return mimeType; }
            set { mimeType = value; }
        }
        #endregion

        /// <summary>
        /// Initializes a new instance of <see cref="RssItemEnclosure"/> class.
        /// </summary>
        public RssItemEnclosure()
        {
        }

        /// <summary>
        /// Initializes a new instance of <see cref="RssItemEnclosure"/> class
        /// with a given URL, length and MIME type.
        /// </summary>
        /// <param name="url">The URL where the enclosure is located.</param>
        /// <param name="length">The size of the enclosure in bytes.</param>
        /// <param name="mimeType">The MIME type of the enclosure.</param>
        public RssItemEnclosure(String url, Int32 length, String mimeType)
        {
            this.url = url;
            this.length = length;
            this.mimeType = mimeType;
        }
    }
}
